<?php global $ubi;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>TÙM LUM site</title>
        
		<link href="include/css/style.css" media="screen" rel="stylesheet" type="text/css" />
		<link href="include/css/styles.css" type="text/css" media="all" rel="stylesheet" id="contact-form-7-css" />
        <link href="include/css/site.css" media="screen" type="text/css" rel="stylesheet" />
		
		<script language="javascript" src="include/script/jquery-1.4.4.min.js" type="text/javascript"></script>
		<script language="javascript" src="include/script/jquery.ba-bbq.min.js" type="text/javascript"></script>
		<?php
		 
		?>
		<script language="javascript" src="include/script/infoScript.js" type="text/javascript"></script>
		
		<script type="text/javascript" language="javascript">
			$(document).ready(function(){
				$('#blockSignIn').load('index.php?load&view=blockSignIn');
				$('#blockSearch').load('index.php?load&view=blockSearch');
				$('#blockMembers').load('index.php?load&view=blockMembers');
				$('#blockNewestPosts').load('index.php?load&view=blockNewestPosts');
				$('#mainMenu').load('index.php?load&view=menu&location=providers');
				$('#randomItemProvider').load('index.php?load&view=randomItemProvider');
				$('#footer').load('index.php?load&view=footer');

				$('#btnView').click(function() {
					$.loadProviders('index.php?view&type=listProviders');
				});	
			});
			
			$.extend({
				loadProviders : function(url) {
					var data = $("#selCity option:selected").text();
					$('#listObjects').load(url, {region:data});
				},
				
				doProcessGetRegion : function(data) {
					if (typeof(data) !== 'undefined') {
						$('#listObjects').load('index.php?view&type=listProviders', {region:data});
						$.post('index.php?location&action=load', {region:data}, function(data) {
							$('#selCity').val(data);	
						});
					}	
				},

				viewPage : function(page) {
					var url = 'index.php?view&type=listProviders';
					var newUrl = url + '&page=' + page;
					$.loadProviders(newUrl);
				}
			});
		</script>
	</head>
    
    <body id="cookoffboard" class="home blog">
		<div id="corners">			
			<div class="header" id="main-head">
				<div id="hdr-info">
                	<div style="float:left">
                        <img id="logo" src="include/imgs/logo4.png" alt="The Cook-Off Board" width="235px" />
                        <p id="desc">Tùm Lum, Tả Pí Lù, chia sẻ tất cả ở đây</p>
                    </div>
                    <div class="nav">
                        <div id="mainMenu"></div>
                        <div style="clear:both"></div>
                    </div>
				</div>               
			</div> <!--end header-->
            
			<div class="polaroids">
            	<div class="marginBoxPicCollection" id="randomItemProvider"></div>                                                                            
            </div> <!--end polaris-->
            
            <div id="container">
				<hr />
                <div class="left">
                    <div class="section" id="content">
                    	<?php
                    		if (isset($_SESSION['userid'])) { 
                    	?>                        
							<input type="button" value="Chia sẻ địa điểm" onclick="location.href='index.php?view&type=shareProvider'" />
						<?php
                    		} 
						?>   
						<br />
						Chọn thành phố :
						<select name="selCity" id="selCity">
						<?php
							if (isset($arrCities)) {
						?>
							<option value=""></option>
						<?php		
								foreach ($arrCities as $city) {
						?>
									<option value="<?php echo $city->getLocationID()?>"><?php echo $city->getName()?></option>
						<?php 			
								}
							} 
						?>
						</select>
						<input type="button" value="Xem" id="btnView" />
						
						<div class="yd_rp_widget search_result" id="listObjects">   
                    	</div>
                    							                                          
                    </div>  <!--end section -->
            	</div> <!-- end left -->        
                <div class="right">
        			<div class="aside">
                        <ul class="blockRightSide">	
                        	<h2 class="widgettitle">Đăng nhập</h2>
                            <li class="blockRight" id="blockSignIn"></li>
                            
                            <h2 class="widgettitle">Tìm kiếm</h2>
                            <li class="blockRight" id="blockSearch"></li>
                            
                            <h2 class="widgettitle">Thành viên</h2>                                            
                            <li class="blockRight" id="blockMembers"></li>
                            
                            <h2 class="widgettitle">Bài đăng mới nhất</h2>
                            <li class="blockRight" id="blockNewestPosts"></li>                          
                        </ul>
                    </div>        
                </div> <!--end right-->
			</div> <!--end container-->		
            
           	<div id="footer" class="footer clearfix"></div>          
		</div>
	</body>
</html>